#include <iostream>
using namespace std;

int n,r;

int main()
{
  cin >> n;
  for(int i = 1;i <= n;i += 2){
    int x = i,flag = 1;
    if(x % 2 == 0) continue;
    int j = 1;
    while(x){
      if(x % 2 != j){
        flag = 0;
        break;
      }
      x /= 10;
      if(j == 1) j = 0;
      else j = 1;
    }
    if(flag){
        r++;
    }
  }
  cout << r << endl;
  return 0;
}
